import entity.Equip;
import entity.Player;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import service.EquipService;
import service.EquipServiceimpl;
import service.PlayerService;
import service.PlayerServiceimpl;

public class Main {
    @Test
    public void test3() {
        ApplicationContext context=new ClassPathXmlApplicationContext("classpath:applicationContext.xml");
        EquipService equipService=(EquipService) context.getBean("equipService");
        PlayerService playerService=(PlayerService) context.getBean("playerService");
        System.out.println("装备：");
        Equip equip=new Equip();
        equip.setName("蓝魔指环");
        equip.setType("指环");
        equip.setSpeedPlus(8L);
        equip.setAttackPlus(12L);
        equip.setDefencePlus(2L);
        Player player=playerService.insert(equipService.insert(equip));
        player.updateEquip(equip);
        System.out.println("速度增效"+player.getArmet().getSpeedPlus()+","
                +"攻击增效"+player.getArmet().getAttackPlus()+","
                +"防御增效"+player.getArmet().getDefencePlus()+"。");
    }
}
